<!-- 新加链接开始 -->
<link href="<?php echo SITETHEME;?>css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?php echo SITETHEME;?>js/default.js"></script>
<script type="text/javascript" src="<?php echo SITETHEME;?>js/FileAPI.js"></script>
<script type="text/javascript" src="<?php echo SITETHEME;?>js/chart_loader.js"></script>
<!-- 新加链接结束 -->
<!-- <div class="indwhere">
    <a href="<?php echo SITEINDEX?>" style="color: #7c7c7c;"><span class="glyphicon glyphicon-home"></span> 首页</a> > <b>个人中心</b>
      &nbsp;&nbsp;&nbsp;&nbsp;<font color="red" size="3px" >发展基金：<?php echo round($r['fazhan_crash'],2);?></font>
</div> -->
<!-- 新加内容开始 -->
<?php 
$total = $r['lixi_crash']+$r["cash_purse"]+$r["freeze_benjin"]+$r['freeze_lixi']+$r["cash_ldprize"]+$r["freeze_ldj"]+$r["presentcoin"];
$sql = "select amount,prize_ltime from ld_prize_list where prize_option = 51 and uid = '".$r['id']."' order by prize_ltime desc" ;
$db->query($sql);
$rs =$db->rs;
?>
 <div class="b-content-line" style="margin-bottom: 15px;">
         <div class="b-investments" id="InvestmentCalc" style="height:225px;">
          <div class="b-investments__graph" style="padding-bottom: 30px;">
           <div class="b-graph">
            <div class="b-graph__head">
             <ul class="b-graph-labels">
              <li class="b-graph-labels__item active" data-curr="PSD" data-ico="icon_icon_psd" data-rate="1.00" data-dot="2"><a class="b-label b-bg-usd"><span class="b-label__text">VIC</span></a></li>
             <!--  <li class="b-graph-labels__item" data-curr="ETH" data-ico="icon_icon_eth" data-rate="458.97" data-dot="6"><a class="b-label b-bg-eth"><span class="b-label__text">ETH</span></a></li> -->
             </ul>
            </div>
            <div class="b-graph__body">
             <div class="b-graph__info">
              <div class="b-graph__title">
               <span class="b-graph__title-icon">
               <i class="b-graph__icon icon_icon_psd">
                 <img src="theme/images/pbccoin.jpg" alt="" style="width:16px;border-radius: 50%;">
               </i>
               </span>
               <span class="b-graph__title-caption">投资业务 <span data-calc-curr="">VIC</span></span>
              </div>
              <div class="b-graph__course">
               价格: 1
               <span data-calc-curr="">PSD</span> =
               <span data-calc-rate=""><?php echo getprice();?></span>CNY
              </div>
             </div>
             <div class="b-graph__table">
              <div class="b-graph__terms">
               <div class="b-graph__terms-wrapper">
                <div class="b-graph__terms-label-cell">
                 <span class="b-graph__terms-label">期限</span>
                </div>
                <div class="b-graph__terms-list-cell">
                 <ul class="b-graph__terms-list">
                 <li class="b-graph__terms-item js-tab-b" id="不限" data-days-discount="0">不限<span>+<?php echo $GLOBALARR['allowtxall'][0]?>%</span></li>
                  <li class="b-graph__terms-item js-tab-b" id="15" data-days-discount="5">15<span>+<?php echo $GLOBALARR['allowtxall'][1]?>%</span></li>
                  <li class="b-graph__terms-item js-tab-b" id="30" data-days-discount="10">30<span>+<?php echo $GLOBALARR['allowtxall'][2]?>%</span></li>
                  <li class="b-graph__terms-item js-tab-b" id="60" data-days-discount="12.5">60<span>+<?php echo $GLOBALARR['allowtxall'][3]?>%</span></li>
                  <li class="b-graph__terms-item js-tab-b active" id="90" data-days-discount="15">90<span>+<?php echo $GLOBALARR['allowtxall'][4]?>%</span></li>
                 </ul>
                </div>
               </div>
              </div>
              <div class="b-graph__value">
               <div class="b-graph__value-table">
                <div class="b-graph__value-input-holder">
                 <input type="text" autocomplete="off" name="amount" maxlength="10" class="b-graph__value-input float_number" placeholder="<?php echo $r['cash_purse']?>"  readonly='readonly'/>
                </div>
                <span class="b-graph__value-currency" data-calc-curr="">PSD</span>
               </div>
               <div class="b-graph__multilabel">
                <span class="b-graph__multilabel-item b-graph__label_theme_purple" data-paycurrency-discount-info=""><span class="b-graph__label-caption"><span class="b-graph__label-caption-text">昨日收益</span></span><span class="b-graph__label-count"><?php if ($rs[0]['amount']){echo $rs[0]['amount'];}else {echo '0.00';}?></span></span>
                <span class="b-graph__multilabel-item"><span class="b-graph__label-caption b-rank_theme_status-bg_1"><span class="b-graph__label-caption-text">累计收益</span></span><span class="b-graph__label-count b-rank_theme_status-txt_1"><?php echo  $r['lixi_crash']; ?></span></span>
               </div>
              </div>
             </div>
            <!--  新加按钮 -->
            <div style="margin-top: 25px;float: right;border:1px solid rgba(255,255,255,0.2);font-size: 18px;text-align: center;padding:10px 0px;cursor:pointer;width:160px;">
            <span><a style="font-weight: normal;color:#fff;" href="<?php echo SITEINDEX?>?lsact=cunkuan">
                锁仓生息</a>
            </span>
            </div>
            <div style="margin-top: 25px;float: right;border:1px solid rgba(255,255,255,0.2);font-size: 18px;text-align: center;margin-right: 10px;padding:10px 0px;cursor:pointer;width:160px;">
            <span><a style="font-weight: normal;color:#fff;" href="<?php echo SITEINDEX?>?lsact=zhuancoin">
               提现</a></span>
            </div>
            <!--  新加按钮 -->
             <div class="b-graph__representation">
             </div>
            </div>
           </div>
          </div>
          <div class="b-investments__profit">
           <div class="b-profit">
            <div class="b-profit__periods">
             <div class="b-profit__period-item">
              <div class="b-profit__period-item-inner">
               <div class="b-profit__period-title">
                <span data-profit-label="">LTC<br />账户余额</span>
               </div>
               <div class="b-profit__period-table">
                <div class="b-profit__period-row">
                 <span class="b-profit__period-cell" data-profit-amount=""><?php echo sprintf("%.4f",$r['ltc_account'])?></span>
                 <span class="b-profit__period-cell" data-calc-curr="">LTC</span>
                </div>
                <div class="b-profit__period-row">
                 <span class="b-profit__period-cell" data-profit-psd="">≈ <?php echo round($r['ltc_account']*getprice_ltc()*getprice_rate()/getprice(),4);?></span>
                 <span class="b-profit__period-cell">VIC</span>
                </div>
               </div>
              </div>
             </div>
             <div class="b-profit__period-item">
              <div class="b-profit__period-item-inner">
               <div class="b-profit__period-title">
                <span data-profit-all-label="">BTC<br />账户余额</span>
               </div>
               <div class="b-profit__period-table">
                <div class="b-profit__period-row">
                 <span class="b-profit__period-cell" data-profit-all-amount=""><?php echo sprintf("%.4f",$r['btc_account'])?></span>
                 <span class="b-profit__period-cell" data-calc-curr="">BTC</span>
                </div>
                <div class="b-profit__period-row">
                 <span class="b-profit__period-cell" data-profit-all-psd="">≈ <?php echo round($r['btc_account']*getprice_btc()*getprice_rate()/getprice(),4);?></span>
                 <span class="b-profit__period-cell">VIC</span>
                </div>
               </div>
              </div>
             </div>
            </div>
           <!--  <div class="b-profit__day">
             <div class="b-profit__day-title">
              每天利润，至
              <span>（每天可以提款）</span>
             </div>
             <ul class="b-profit__day-table">
              <li class="b-profit__day-row"><span class="b-profit__day-cell" data-profit-day-amount="">0.00</span><span class="b-profit__day-cell" data-calc-curr="">PSD</span></li>
              <li class="b-profit__day-row"><span class="b-profit__day-cell" data-profit-day-psd="">0.00</span><span class="b-profit__day-cell">PSD</span></li>
              <li class="b-profit__day-row"><span class="b-profit__day-cell" data-profit-day-percent="">1.00</span><span class="b-profit__day-cell">%</span></li>
             </ul>
            </div> -->
            <!-- id="DoCheckNewInvest"  -->
            <div class="b-profit__control">
            <a href="/home.php?lsact=zhuancoin&templist=2" class="b-profit__button" style="display: inline-block;width:163px;">
            <span class="b-profit__button-text">充值</span>
            </a>
             <a href="/home.php?lsact=zhuanhuan" class="b-profit__button"  style="display: inline-block;width:163px;margin-left: 14px;">
             <span class="b-profit__button-text">兑换PSD</span></a>
            </div>
           </div>
          </div>
         </div>
        </div>
        <script> google.charts.load('current', {'packages': ['corechart']});
    google.charts.setOnLoadCallback(drawChart);

    var chart_width = 0,
        last_procent_correct = -1,
        data_for_chart = [
            ['29.11', 1.00],
            ['30.11', 0.93],
            ['01.12', 0.66],
            ['02.12', 0.68],
            ['03.12', 0.58],
            ['04.12', 0.57],
            ['05.12', 0.61],
            ['06.12', 0.89],
            ['05.12', 0.61]
        ],
        resize_chart = function () {
            var new_chart_width = $('.b-graph__chart-body').width();
            if (new_chart_width != chart_width && window.invest_chart) {
                window.invest_chart.draw(window.invest_chart_data, window.invest_chart_options);
                chart_width = new_chart_width;
            }
        },
        resize_chart_point = function(percent, amount, curr, dot) {
            for (i = 0; i < 9; i++) {
                var n = (data_for_chart[i][1]*1 * (1 + (percent / 100))).toFixed(2),
                    a = (amount * (n / 100)).toFixed(dot);
                window.invest_chart_data.setValue(i, 1, n);
                window.invest_chart_data.setValue(i, 3, n + '%');
                window.invest_chart_data.setValue(i, 2, (a > 0 ? a + ' ' + curr : ''));
                window.invest_chart.draw(window.invest_chart_data, window.invest_chart_options);
            }
        },
        calculate_amounts = function () {

            var currency = $('#InvestmentCalc .b-graph-labels__item.active'),
                rate = (parseFloat(currency.attr('data-rate')) || 0),
                dotnum = (parseFloat(currency.attr('data-dot')) || 2),

                amount = (parseFloat($('#InvestmentCalc input[name="amount"]').val().replace(',', '.')) || 0),
                days = $('#InvestmentCalc .b-graph__terms-item.active').attr('id'),

                discount_days = (parseFloat($('#InvestmentCalc .b-graph__terms-item.active').attr('data-days-discount')) || 0),
                discount_paysys = 0,
                invclose = (parseFloat($('#InvestmentCalc input[type="checkbox"][name="invest_close"]:checked').attr('data-recalc')) || 0),
                invinsurance = (parseFloat($('#InvestmentCalc input[type="checkbox"][name="invest_insurance"]:checked').attr('data-recalc')) || 0)
                percent = 0;

            if (currency.attr('data-curr') == 'PSD') {
                invinsurance = 0;
            }

            if (currency.attr('data-curr') == 'OCC') {
                discount_paysys = 5;
                $('[data-paycurrency-discount-info]').show();
            } else {
                $('[data-paycurrency-discount-info]').hide();
            }

            percent += discount_paysys;
            percent -= invinsurance;

            if (invclose > 0) {
                percent -= invclose;
            } else {
                percent += discount_days;
            }

            var last_30_percent = 25.99 * (1 + (percent / 100)),

                profit_day_percent = last_30_percent / 30,
                profit_day_amount = amount * (profit_day_percent / 100),
                profit_day_psd = profit_day_amount * rate,

                profit_percent = profit_day_percent * days,
                profit_amount = amount * (profit_percent / 100),
                profit_psd = profit_amount * rate,

                profit_all_percent = profit_percent + 100,
                profit_all_amount = amount * (profit_all_percent / 100),
                profit_all_psd = profit_all_amount * rate;

            $('#InvestmentCalc span[data-percent-last-30-days]').html(last_30_percent.toFixed(2) + '<span>%</span>');

            $('#InvestmentCalc span[data-profit-day-amount]').text(profit_day_amount.toFixed(dotnum));
            $('#InvestmentCalc span[data-profit-day-psd]').text(profit_day_psd.toFixed(2));
            $('#InvestmentCalc span[data-profit-day-percent]').text(profit_day_percent.toFixed(2));

            $('#InvestmentCalc span[data-profit-label]').html($('#InvestmentCalc span[data-profit-label]').html().replace(/[0-9]+/g, days));
            $('#InvestmentCalc span[data-profit-amount]').text(profit_amount.toFixed(dotnum));
            $('#InvestmentCalc span[data-profit-psd]').text(profit_psd.toFixed(2));
            $('#InvestmentCalc span[data-profit-percent]').text(profit_percent.toFixed(2));

            $('#InvestmentCalc span[data-profit-all-label]').html($('#InvestmentCalc span[data-profit-all-label]').html().replace(/[0-9]+/g, days));
            $('#InvestmentCalc span[data-profit-all-amount]').text(profit_all_amount.toFixed(dotnum));
            $('#InvestmentCalc span[data-profit-all-psd]').text(profit_all_psd.toFixed(2));
            $('#InvestmentCalc span[data-profit-all-percent]').text(profit_all_percent.toFixed(2));

            last_procent_correct = percent;
            resize_chart_point(percent.toFixed(2), amount, currency.attr('data-curr'), dotnum);

            $('#InvestmentCalc .b-graph__value-input-errortext').remove();

        },
    function drawChart() {

        window.invest_chart_data = new google.visualization.DataTable();
        window.invest_chart_data.addColumn('string', 'Date');
        window.invest_chart_data.addColumn('number', 'Percent');
        window.invest_chart_data.addColumn({type: 'string', role: 'annotation'});
        window.invest_chart_data.addColumn({type: 'string', role: 'annotation'});
        var currency = $('#InvestmentCalc .b-graph-labels__item.active').attr('data-curr');
        for (i=0; i<9; i++) {
            var n = 0.5;            window.invest_chart_data.addRow([data_for_chart[i][0], parseFloat(n), n + '%', '']);
        }
        window.invest_chart_options = {
            vAxis: {baselineColor: '#31A0E6', gridlines: {color: '#31A0E6'}, minValue: 0},
            annotations: {stem: {length: 10, color: 'transparent'}, textStyle: {fontSize: 10, bold: false, color: '#ffffff'}},
            chartArea: {left: 0, top: 5, width: "100%", height: 85},
            backgroundColor: '#31A0E6', colors: ["#AED7F2"], pointSize: 6, enableInteractivity: false, legend: 'none', width: "100%", height: 90
        };
        window.invest_chart = new google.visualization.AreaChart(document.getElementById('calc_chart'));
        window.invest_chart.draw(window.invest_chart_data, window.invest_chart_options);
        chart_width = $('.b-graph__chart-body').width();
        setInterval(resize_chart, 10);

        calculate_amounts();

    }

    $(document).ready(function(){

        calc_to_start_invest_timer();
        setInterval(calc_to_start_invest_timer, 1000);

        // Calc
        $(document).on('click', '#InvestmentCalc .b-graph-labels__item', function(e){
            e.preventDefault();
            $(this).addClass('active').siblings().removeClass('active');
            $('#InvestmentCalc [data-calc-curr]').text($(this).attr('data-curr'));
            $('#InvestmentCalc .b-graph__title-icon').html('<i class="b-graph__icon ' + $(this).attr('data-ico') + '"></i>');
            $('#InvestmentCalc [data-calc-rate]').text($(this).attr('data-rate'));
            if ($(this).attr('data-curr') == 'PSD') {
                $('#InvestmentCalc [data-insurance-check] input[type="checkbox"]').removeAttr('checked');
                $('#InvestmentCalc [data-insurance-check]').hide();
            } else {
                $('#InvestmentCalc [data-insurance-check]').show();
            }
            calculate_amounts();
            return false;
        });
        $(document).on('change', '#InvestmentCalc input[type="checkbox"]', function () { calculate_amounts(); });
        $(document).on('keyup', '#InvestmentCalc input[type="text"]', function () { calculate_amounts(); });
        $(document).on('click', '#InvestmentCalc .b-graph__terms-item', function () { calculate_amounts(); });
        $(document).on('click', '#InvestmentCalc a#DoCheckNewInvest', function(){
            var w = $(this).parents('.b-profit__control'),
                o = {
                pscode: $('#InvestmentCalc .b-graph-labels__item.active').attr('data-curr'),
                amount: $('#InvestmentCalc input[name="amount"]').val(),
                days: $('#InvestmentCalc .b-graph__terms-item.active').attr('id'),
                insurance: ($('#InvestmentCalc input[type="checkbox"][name="invest_insurance"]').is(':checked') ? 1 : 0),
                close: ($('#InvestmentCalc input[type="checkbox"][name="invest_close"]').is(':checked') ? 1 : 0)
            };
            w.addClass('waitsenddata');
            $.post('/a/dochecknewinvest/', o, function (data) {
                w.removeClass('waitsenddata');
                if (data.w) { ModalRightWindow(data.w); }
                if (data.m) { ModalRightWindow(data.m); }
                if (data.a) {
                    $('#InvestmentCalc input[name="amount"]').after('<div class="b-graph__value-input-errortext">' + data.a + '</div>');
                }
            }, 'json');
            return false;
        });
        $(document).on('click', 'button#ConfirmAddNewInvest', function(){
            var f = $(this).parents('[data-form]');
            f.addClass('waitsenddata');
            $.post('/a/dosavenewinvest/', $('input', f), function (data) {
                f.removeClass('waitsenddata');
                if (data.s) {
                    f.parents('.b-side-overlay').remove();
                    $('li[data-invest-code]').css('display', 'block');
                }
                if (data.li) {
                    $('[data-invest-list-noitems]').remove();
                    if ($('ul[data-invest-list-load] li[data-invest-code]').length) {
                        $('li[data-invest-code]:first').before(data.li);
                    } else {
                        $('ul[data-invest-list-load]').append(data.li);
                    }
                }
                if (data.m) { ModalRightWindow(data.m); }
            }, 'json');
            return false;
        });

        // Invest List
        $('.js-tab-invlist').click(function(e){
            e.preventDefault();
            $(this).addClass('active').siblings().removeClass('active');
            if (typeof $(this).attr('data-curr') == 'undefined') {
                $('li[data-invest-code]').css('display', 'block');
            } else {
                $('li[data-invest-code]').css('display', 'none');
                $('li[data-invest-code="' + $(this).attr('data-curr') + '"]').css('display', 'block');
            }
        });

        // Add Amount Invest
        $(document).on('click', '[data-button="addinvestmoney"]', function () {
            var li = $(this).parents('li.b-case');
            li.addClass('abswaitsenddata');
            $.post('/a/addinvestamountgetwnd/', {iid: li.attr('data-invest')}, function (data) {
                li.removeClass('abswaitsenddata');
                if (data) { ModalRightWindow(data); }
            });
            return false;
        });
        $(document).on('click', 'button#ConfirmAddInvestAmount', function () {
            var f = $(this).parents('[data-form]');
            f.addClass('waitsenddata');
            $.post('/a/addinvestamount/', $('input', f), function (data) {
                f.removeClass('waitsenddata');
                if (data.m) {
                    f.parents('.b-side-overlay').remove();
                    ModalRightWindow(data.m);
                }
                if (data.err) { $('input[name="amount"]', f).before('<span class="b-form-block__main-input-error"><span>' + data.err + '</span></span>'); }
            }, 'json');
            return false;
        });

        // Withdraw
        $(document).on('click', '[data-button="withdrawmoney"]', function () {
            var li = $(this).parents('li.b-case');
            li.addClass('abswaitsenddata');
            $.post('/a/withdrawinvestamountgetwnd/', {iid: li.attr('data-invest')}, function (data) {
                li.removeClass('abswaitsenddata');
                if (data) { ModalRightWindow(data); }
            });
            return false;
        });
        $(document).on('click', 'button#ConfirmDoWithdrawInvestProfit', function () {
            var f = $(this).parents('[data-form]');
            f.addClass('waitsenddata');
            $.post('/a/withdrawinvestamount/', $('input[type="hidden"],input[type="radio"]:checked', f), function (data) {
                f.removeClass('waitsenddata');
                if (data.m) {
                    f.parents('.b-side-overlay').remove();
                    ModalRightWindow(data.m);
                }
                if (data.i) {
                    var b = $('li.b-case[data-invest="' + data.i + '"]');
                    $('.b-case__exchange-count', b).text('0.00');
                    if (b.is('[data-invest-is-closed]')) $('.b-case__controls', b).remove();
                }
            }, 'json');
            return false;
        });

        //Close Invest
        $(document).on('click', '[data-button="closeinvest"]', function () {
            var li = $(this).parents('li.b-case');
            li.addClass('abswaitsenddata');
            $.post('/a/closeinvestgetwnd/', {iid: li.attr('data-invest')}, function (data) {
                li.removeClass('abswaitsenddata');
                if (data) { ModalRightWindow(data); }
            });
            return false;
        });
        $(document).on('click', 'button#ConfirmDoCloseInvest', function () {
            var f = $(this).parents('[data-form]');
            f.addClass('waitsenddata');
            $.post('/a/closeinvest/', $('input[type="hidden"]', f), function (data) {
                f.removeClass('waitsenddata');
                if (data.m) {
                    f.parents('.b-side-overlay').remove();
                    ModalRightWindow(data.m);
                }
                if (data.i) {
                    var b = $('li.b-case[data-invest="' + data.i + '"]');
                    $('[data-button="closeinvest"],[data-button="addinvestmoney"]', b).remove();
                    $('[data-button="withdrawmoney"]', b).css('display', 'block');
                    if (data.a) $('.b-case__exchange-count[data-wamount]', b).text(data.a);
                    if (data.u) $('.b-case__exchange-count[data-wamount-psd]', b).text(data.u);
                }
            }, 'json');
            return false;
        });

        // Stat Invest Item
        $(document).on('click', '[data-button="InvestStatistic"]', function () {
            var li = $(this).parents('li.b-case');
            if ($(this).hasClass('active')) {
                $(this).removeClass('active');
                //$('.b-case__stats', li).removeClass('active');
                $('.b-case__stats', li).remove();
            } else {
                $(this).addClass('active');
                if ($('.b-case__stats', li).length) {
                    $('.b-case__stats', li).addClass('active');
                } else {
                    li.addClass('abswaitsenddata');
                    $.get('/a/getinveststatisticinlist/', {iid: li.attr('data-invest')}, function (data) {
                        li.removeClass('abswaitsenddata');
                        if (data) {
                            $('.b-case__wrapper', li).after(data);
                            if ($('ul.js-stats-item-slider li', li).length > 1) {
                                window.sliderInvestItem[li.attr('data-invest')] = $('.js-stats-item-slider', li).bxSlider({controls:false, auto:false});
                            }
                        }
                    });
                }
            }
            return false;
        });

        // Stat Invest List
        $(document).on('click', '[data-list-invest] li', function () {
            var li = $(this);
            if ($(this).hasClass('active') || $(this).hasClass('b-stats-list__item-free')) { return false; }

            $(this).addClass('active').siblings().removeClass('active');

            var o = {iid: $('[data-list-invest] li.active[data-list-invest-id]:last').attr('data-list-invest-id')};

            li.addClass('abswaitsenddata');
            $.get('/a/getinveststatisticlist/', o, function (data) {
                li.removeClass('abswaitsenddata');
                $('[data-list-invest-statistic]').html(data.l);
                $('[data-button="LoadMoreInvestStatisticTable"]').parent().css('display', (data.h ? 'none' : 'block'));
            }, 'json');

            return false;
        });
        $(document).on('click', '[data-button="LoadMoreInvestStatisticTable"]', function () {
            var li = $(this).parent(),
                o = {
                    iid: $('[data-list-invest] li.active[data-list-invest-id]:last').attr('data-list-invest-id'),
                    c: $('[data-list-invest-statistic] tr').length
                };

            li.addClass('abswaitsenddata');
            $.get('/a/getinveststatisticlist/', o, function (data) {
                li.removeClass('abswaitsenddata');
                if (data.l) { $('[data-list-invest-statistic]').append(data.l); }
                $('[data-button="LoadMoreInvestStatisticTable"]').parent().css('display', (data.h ? 'none' : 'block'));
            }, 'json');

            return false;
        });

        // Tabs
        $(document).on('click', '[data-invest-tab]', function () {
            var tab = $(this).attr('data-invest-tab'),
                b = $(this).parents('.b-content-head__tabs'),
                a = $('[data-invest-tab-area="' + tab + '"]');

            if (a.html() != '') {
                $('[data-invest-tab-area]').css('display', 'none');
                $('[data-invest-tab-area="' + tab + '"]').css('display', 'block');
            } else {
                b.addClass('waitsenddata');
                $.get('/a/' + tab + '/', {x: Math.random()}, function (data) {

                    b.removeClass('waitsenddata');

                    $('[data-invest-tab-area]').css('display', 'none');
                    $('[data-invest-tab-area="' + tab + '"]').css('display', 'block');
                    a.html(data);

                    window.recalc_statistic_slides_count();

                    var c = window.oStatBxSettings.minSlides - $('.js-stats-slider li').length;
                    if (c >= 0) {

                        if (c > 0) for (var i=c; i>0; i--) $('.js-stats-slider').append('<li class="b-stats-list__item b-stats-list__item-free"></li>');

                        var width = $('.js-stats-width').width(),
                            w = (width - ((window.oStatBxSettings.minSlides - 1) * 20)) / window.oStatBxSettings.minSlides;
                        $('.js-stats-slider li').css('width', w + 'px');
                        window.sliderInvestStatisticTab = $('.js-stats-slider');

                    } else {

                        window.sliderInvestStatisticTab = $('.js-stats-slider').bxSlider(window.oStatBxSettings);

                    }

                    if (tab == 'investtradingstatistic') load_investstat_graph_init();

                });
            }

            return false;
        });

        // Graph
        window.invest_trade_chart = false;
        function load_investstat_graph_data(isExchange) {
            $('.b-invtrading_chart').addClass('waitsenddata');
            var o = {e: $('[data-invgraph-exchange-id].active').attr('data-invgraph-exchange-id')};
            if (isExchange !== true) {
                o['p'] = $('[data-invgraph-pair-id].active').attr('data-invgraph-pair-id');
            }
            $.get('/a/loadinveststatgraphdata/', o, function (data) {
                $('.b-invtrading_chart').removeClass('waitsenddata');
                if (data.l) {
                    window.invest_trade_chart.dataSets[0].dataProvider = data.l;
                    window.invest_trade_chart.validateData();
                }
                if (data.lp) {
                    $('[data-invgraph-pair-id]:first').parent().html(data.lp);
                }
            }, 'json');
        }
        function load_investstat_graph_init() {

            window.invest_trade_chart = AmCharts.makeChart("invest_trading_chart", {
                "type": "stock",
                "parseDates": true,
                "addClassNames": true,
                "dataSets": [{"color":"#1f2128", "dataProvider":[], "categoryField": "date", "fieldMappings": [{"fromField": "open", "toField": "open"}, {"fromField": "close", "toField": "close"}, {"fromField": "high", "toField": "high"}, {"fromField": "low", "toField": "low"}]}],
                "panels": [{"stockGraphs": [{"id": "g1", "type": "candlestick", "openField": "open", "closeField": "close", "highField": "high", "lowField": "low", "valueField": "close", "lineColor": "#90dc34", "fillColors": "#90dc34", "negativeLineColor": "#df721b", "negativeFillColors": "#df721b", "fillAlphas": 1, "useDataSetColors": false,"balloonText": "Open: <strong>[[open]]</strong><br />Close: <strong>[[close]]</strong><br />Low: <strong>[[low]]</strong><br />High: <strong>[[high]]</strong>"}]}],
                "panelsSettings": {"marginLeft": 100, "marginRight": 20},
                "chartScrollbarSettings": {"graph": "g1", "graphFillAlpha": 0, "backgroundColor": "#474B58", "selectedBackgroundColor": "#CCCED8", "gridColor": "#1f2128", "gridAlpha": 0.1},
                "categoryAxesSettings": {"gridColor": "#7f8799", "dashLength": 5, "color": "#7f8799", "groupToPeriods": ["30mm", "hh", "6hh"], "minPeriod": "mm"},
                "valueAxesSettings": {"gridColor": "#7f8799", "dashLength": 5, "color": "#7f8799", "inside": false},
                "chartCursorSettings": {"cursorColor": '#474b58', "color": "#f1f1f3", "categoryBalloonText": '<div class="b-invtrading_chart__time_text">[[category]]</div>', "categoryBalloonAlpha": 0.9, "cornerRadius": 0},
                "balloon": {"fillAlpha": 0.9, "fillColor": '#ccced8', "borderThickness": 0, "shadowAlpha": 0, "horizontalPadding": 10, "verticalPadding": 10, "cornerRadius": 0},
                "periodSelector": {"dateFormat": "YYYY-MM-DD", "inputFieldWidth": 120, "inputFieldsEnabled": false, "periods": [{"period": "DD", "count": 1, "label": "1 day", "selected": true},{"period": "WW", "count": 1, "label": "1 week", "selected": true},{"period": "WW", "count": 2, "label": "2 weeks", "selected": true},{"period": "MAX", "label": "MAX"}]},
                "dataDateFormat": "YYYY-MM-DD HH:NN:SS"
            });

            load_investstat_graph_data();

        }
        if ($('#invest_trading_chart').length) load_investstat_graph_init();
        $(document).on('click', '[data-invgraph-exchange-id]', function (e) {
            e.preventDefault();
            var el = $(this);
            el.addClass('active').siblings().removeClass('active');
            load_investstat_graph_data(true);
        });
        $(document).on('click', '[data-invgraph-pair-id]', function (e) {
            e.preventDefault();
            var el = $(this);
            el.addClass('active').siblings().removeClass('active');
            load_investstat_graph_data();
        });

    });

</script>
<!-- 新加内容结束 -->
<!-- <div class="indent-r-kuai-image clear" style="margin-top: 15px;">
    <div class="row" style="text-align: center;">
        <div class="col-md-6">
            <span class="kuai-im" style="background:#0095d8;"><a href="<?php echo SITEINDEX?>?lsact=cunkuan">
                <img src="theme/images/buticon1.png">锁仓生息</a>
            </span>
        </div>
       <div class="col-md-4">
            <span class="kuai-im" style="background:#dd1c21;"><a href="<?php echo SITEINDEX?>?lsact=productlist"><img src="theme/images/buticon3.png">共享商城</a></span>
        </div>
        <div class="col-md-6">
            <span class="kuai-im" style="background:#86c341;"><a href="<?php echo SITEINDEX?>?lsact=zhuancoin">
                <img src="theme/images/buticon2.png">虚拟币转出</a></span>
        </div>
      <div class="col-md-6">
            <span class="kuai-im im5" style="margin-right: 0px;"><a href="<?php echo SITEINDEX?>?lsact=qukuan"><img src="theme/images/getbg.png">获取帮助</a></span>
        </div>
    </div>
</div> -->

<style type="text/css">
    .indwhere{line-height: 38px;background:#fff url(theme/images/lefticon.jpg) left center no-repeat;color: #7c7c7c;font-size: 12px;padding-left: 15px;margin-bottom: 20px;}
</style>